 <!--
 * @Author: your name
 * @Date: 2019-10-24 15:52:39
 * @LastEditTime: 2019-10-25 14:48:31
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Pass approval system\src\components\userApplicationList\index.vue
 -->
 <template>
   <div>
    <el-table :data="applyList" :header-cell-style="thStyle">
        <el-table-column
          prop="user_type"
          label="申请人类型"
          width=""
          show-overflow-tooltip
        >
        <template slot-scope="scope">
           <span v-if="scope.row.user_type == 0">个人用户</span>
            <span v-else>企业用户</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="passLicenseType"
          label="通行证种类"
          width=""
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="plateType"
          label="号牌种类"
          show-overflow-tooltip>
        </el-table-column>
        <el-table-column
          prop="plateNo"
          label="号牌号码"
          width=""
          :filters="[{ text: '个人用户', value: '个人用户' }, { text: '单位用户', value: '单位用户' }]"
          :filter-method="filterType"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="开始日期"
          width=""
          show-overflow-tooltip
        >
         <template slot-scope="scope">
            <span>{{scope.row.startDate?$dayjs(scope.row.startDate).format('YYYY-MM-DD'):""}}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="endDate"
          label="结束日期"
          width=""
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span>{{scope.row.endDate?$dayjs(scope.row.endDate).format('YYYY-MM-DD'):""}}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="申请日期"
          width=""
          show-overflow-tooltip
        >
         <template slot-scope="scope">
            <span>{{scope.row.applyCreatetime?$dayjs(scope.row.applyCreatetime).format('YYYY-MM-DD'):""}}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="applyRoute"
          label="申请路线"
          width=""
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="startPosition"
          label="起点"
          width=""
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="endPosition"
          label="终点"
          width=""
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
        label="申请状态"
        width=""
        :filters="[{ text: '已禁用', value: '已禁用' }, { text: '已拒绝', value: '已拒绝' },{ text: '申请中', value: '申请中' }, { text: '已核准', value: '已核准' }]"
        :filter-method="filterStatus"
        show-overflow-tooltip
        >
         <template slot-scope="scope">
            <span v-if="scope.row.status == 0">未审核</span>
            <span v-if="scope.row.status == 1">已批准</span>
            <span v-if="scope.row.status == 2">已拒绝</span>
      </template>
        </el-table-column>
        <el-table-column label="操作"  width="">
          <template slot-scope="scope">
              <el-button type="primary" @click="handleEdit(scope.$index,scope.row)" size="mini">查看
              </el-button>
          </template>
        </el-table-column>
    </el-table>
  </div>
 </template>
<script>
export default {
  props: ['applyList'],
  data () {
    return {
      id: 0,
      thStyle: {
        fontSize: '16px'
      }
    }
  },
  methods: {
    handleEdit (index, row) {
      this.id = row.id
      this.$router.push({ name: 'licenseApplicationInfo', params: { 'id': this.id } })
    },
    filterType () {

    },
    filterStatus () {

    }
  }
}
</script>

<style scoped>
  .el-table{
      margin-top:-15px;
      font-size: 15px;
  }
</style>
